package team.nmsg.ge.system.init;

import javax.servlet.MultipartConfigElement;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MultipartConfig {

	@Bean
	public MultipartConfigElement multipartConfigElement() {
		MultipartConfigFactory factory = new MultipartConfigFactory();
		factory.setMaxFileSize("50MB");
		factory.setMaxRequestSize("50MB");
		String applicationDir = System.getProperty("user.dir");
		factory.setLocation(applicationDir); //设置文件上传时，相对路径的根路径
		return factory.createMultipartConfig();
	}

}